package elicecn.web.util;

import java.util.Properties;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

public class DecryptPropertyPlaceholderConfigurer extends
		PropertyPlaceholderConfigurer {

	protected String resolvePlaceholder(String placeholder, Properties props) {
		String value = props.getProperty(placeholder);
		if ("jdbc.password".equals(placeholder) && value != null) {
			value = Encrypter.decrypt(value);
		}
		return value;
	}
}
